import request from '@/utils/request'

// 查询场站管理列表
export function listStation(query) {
  return request({
    url: '/business/station/list',
    method: 'get',
    params: query
  })
}

// 查询场站管理详细
export function getStation(id) {
  return request({
    url: '/business/station/' + id,
    method: 'get'
  })
}

// 新增场站管理
export function addStation(data) {
  return request({
    url: '/business/station/save',
    method: 'post',
    data: data
  })
}

// 修改场站管理
export function updateStation(data) {
  return request({
    url: '/business/station',
    method: 'put',
    data: data
  })
}

// 删除场站管理
export function delStation(id) {
  return request({
    url: '/business/station/' + id,
    method: 'delete'
  })
}
// 查询地区子地区(根据父节点)
export function getAllChildAreaByParentId(parentId) {
  return request({
    url: '/business/region/tree/' + parentId,
    method: 'get'
  })
}

//查询所有场站
export function getAllStation() {
  return request({
    url: '/business/station/all/list/',
    method: 'get'
  })
}

//根据场站id查询充电桩列表
export function getAllDeviceByStationId(stationId) {
  return request({
    url: `/business/manager/getAllDeviceByStationId/${stationId}`,
    method: 'get'
  })
}

//获取所有场站
export function getAllChargeStation() {
  return request({
    url: `/business/station/all/list`,
    method: 'get'
  })
}

//根据代理商ID查询场站列表
export function getAllStationByAgentId(agentId) {
  return request({
    url: `/business/station/all/ByAgentId/${agentId}`,
    method: 'get'
  })
}
